// tab导航
var navList = [
  {
    name: "主页"
  }
];

// 头部菜单导航

// 平台应用
var applyList = [
  {
    name: "财务管理-1",
    list: [
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      }
    ]
  },
  {
    name: "财务管理-2",
    list: [
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      }
    ]
  },
  {
    name: "财务管理-3",
    list: [
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      }
    ]
  },
  {
    name: "财务管理-4",
    list: [
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      }
    ]
  },
  {
    name: "财务管理-5",
    list: [
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      }
    ]
  },
  {
    name: "财务管理-6",
    list: [
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      }
    ]
  },
  {
    name: "财务管理-7",
    list: [
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: true
      },
      {
        name: "电子银行系统",
        isIE: true,
        isChrome: false
      },
      {
        name: "电子银行系统",
        isIE: false,
        isChrome: true
      }
    ]
  }
];

function setMenuList(className) {
  var applyDom = document.getElementsByClassName(className)[0];
  var applyStr = "";
  for (var i = 0; i < applyList.length; i++) {
    var itemStr = "";
    var list = applyList[i].list;
    applyStr +=
      '<div class="apply-item"><span class="apply-item-title"><i class="iconfont icon-shaixuanjiantou-you"></i><span>' +
      applyList[i].name +
      '</span></span><span class="apply-item-list">';
    for (var n = 0; n < list.length; n++) {
      itemStr += '<span class="apply-a">';
      if (list[n].isIE) {
        itemStr += '<img class="ie-img" src="../image/IE.png" alt="">';
      }
      if (list[n].isChrome) {
        itemStr += '<img class="chrome-img" src="../image/Chrome.png" alt="">';
      }
      itemStr += "<span>" + list[n].name + "</span></span>";
    }
    applyStr += itemStr;
    applyStr += "</span></div></div>";
  }
  applyDom.innerHTML = applyStr;
}

// 设置平台应用菜单
setMenuList("apply-con");

// 设置事项
setOption("thing-item", "thingName");

// 常用报表
var commonReports = [
  {
    id: "1",
    name: "手机签约明细"
  },
  {
    id: "1",
    name: "手机号转账签约明细"
  },
  {
    id: "1",
    name: "手机签约明细"
  },
  {
    id: "1",
    name: "手约明细"
  },
  {
    id: "1",
    name: "手机号转账签约明细"
  },
  {
    id: "1",
    name: "手机签约明细"
  },
  {
    id: "1",
    name: "手机约明细"
  },
  {
    id: "1",
    name: "手机号转账签约明细"
  },
  {
    id: "1",
    name: "手约明细"
  },
  {
    id: "1",
    name: "手机号约明细"
  },
  {
    id: "1",
    name: "手机号转账签约明细"
  },
  {
    id: "1",
    name: "手机约明细"
  },
  {
    id: "1",
    name: "手机号转账签约明细"
  },
  {
    id: "1",
    name: "手机签约明细"
  },
  {
    id: "1",
    name: "小微快捷贷"
  },
  {
    id: "1",
    name: "贷款明细"
  },
  {
    id: "1",
    name: "资产饼状图"
  },
  {
    id: "1",
    name: "个人核心客户新增完成情况"
  }
];
var commonReportsDom = document.getElementsByClassName("common-reports")[0];
var commonReportsStr = "";
for (var i = 0; i < commonReports.length; i++) {
  commonReportsStr +=
    '<span class="common-reports-item">' + commonReports[i].name + "</span>";
}
commonReportsDom.innerHTML = commonReportsStr;

// 考勤记录
var attendanceRecord = [
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  },
  {
    month: "2月",
    year: "2019年"
  }
];
var attendanceRecordDom = document.getElementsByClassName(
  "attendance-record"
)[0];
var attendanceRecordStr = "";
for (var i = 0; i < attendanceRecord.length; i++) {
  attendanceRecordStr +=
    '<span class="attendance-record-item"><div class="month">' +
    attendanceRecord[i].month +
    '</div><div class="year">' +
    attendanceRecord[i].year +
    "</div></span>";
}
attendanceRecordDom.innerHTML = attendanceRecordStr;

// 待办事项
var toDos = [
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  },
  {
    name: "今日是xx等人的生日,送给客户…",
    time: "2019.05.20  12:00"
  }
];
var toDosDom = document.getElementsByClassName("to-do")[0];
var toDosStr = "";
for (var i = 0; i < toDos.length; i++) {
  toDosStr +=
    '<div class="to-do-item"><i class="iconfont icon-bianzubeifen"></i><span class="to-do-item-con"><span class="todo-itemcon-left"><div class="todo-title">' +
    toDos[i].name +
    '</div><div class="todo-date">' +
    toDos[i].time +
    '</div></span><span class="handle">处理</span></span></div>';
}
toDosDom.innerHTML = toDosStr;

// 全部系统
var system = [
  {
    icon: "icon-yonghu",
    name: "网上银行系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  },
  {
    icon: "icon-yonghu",
    name: "网上银行内管系统"
  }
];
var systemDom = document.getElementsByClassName("system-list")[0];
var systemStr = "";
for (var i = 0; i < system.length; i++) {
  systemStr +=
    '<div class="system-item-box"><span class="system-i"><i class="iconfont ' +
    system[i].icon +
    '"></i></span><span class="system-name">' +
    system[i].name +
    "</span></div>";
}
systemDom.innerHTML = systemStr;

// 通讯录
var contacts = [
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  },
  {
    name: "范小闲",
    phone: "18814599001 / 599001"
  }
];
var contactDom = document.getElementsByClassName("tongxunlu-list")[0];
var contactStr = "";
for (var i = 0; i < contacts.length; i++) {
  contactStr +=
    '<li class="search-item"><span>' +
    contacts[i].name +
    "</span><span>" +
    contacts[i].phone +
    "</span></li>";
}
contactDom.innerHTML = contactStr;

// tab：通知公告、新闻动态、系统更新
var tabs = [
  {
    id: "0",
    name: "通知公告",
    list: [
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      }
    ]
  },
  {
    id: "1",
    name: "新闻动态",
    list: [
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: true
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: false
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: true
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: false
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: true
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: false
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: true
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: false
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: true
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: false
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: true
      },
      {
        img: "../image/lion.jpg",
        name: "我行召开党委中心组学习扩大会",
        con: "该部分显示为正文内容，该段描述可能较长该段描述可能较长…",
        time: "2019-11-14",
        isNew: false
      }
    ]
  },
  {
    id: "0",
    name: "系统更新",
    list: [
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      },
      {
        name: "上线变更通知 (2019-11-14)",
        con:
          "关于管理会计-多维报表申请关于关于管理会计多维报表申请管理会计多维报表申请维报表申请理会计多维报表申请",
        time: "2019-11-14"
      }
    ]
  }
];
var tabNameDom = document.getElementsByClassName("tab-box")[0];
var announcementDom = document.getElementsByClassName("announcement")[0];
var newsDom = document.getElementsByClassName("news")[0];
var systemUpdateDom = document.getElementsByClassName("system-update")[0];
var tabNameStr = "";
var announcementStr = "";
var newsStr = "";
var systemUpdateStr = "";

// 设置tab头部名称
for (var i = 0; i < tabs.length; i++) {
  tabNameStr += '<span class="tab-name">' + tabs[i].name + "</span>";
  var list = tabs[i].list;
  for (var n = 0; n < list.length; n++) {
    if (i === 0) {
      announcementStr +=
        '<div class="announcement-item"><span class="dot">•</span><span class="text-color announcement-item-name">' +
        list[n].name +
        '</span><span class="text-color announcement-item-con">' +
        list[n].con +
        '</span><span class="announcement-time">' +
        list[n].time +
        "</span></div>";
    }
    if (i === 1) {
      newsStr +=
        '<div class="news-item"><span class="news-left"><img src="' +
        list[n].img +
        '" alt=""></span><span class="news-right"><div class="news-right-top">' +
        (list[n].isNew ? '<span class="is-new">最新</span>' : "") +
        "<span>" +
        list[n].name +
        '</span><span class="news-time">' +
        list[n].time +
        '</span></div><div class="news-right-bot">' +
        list[n].con +
        "</div></span></div>";
    }
    if (i === 2) {
      systemUpdateStr +=
        '<div class="announcement-item"><span class="dot">•</span><span class="text-color announcement-item-name">' +
        list[n].name +
        '</span><span class="text-color announcement-item-con">' +
        list[n].con +
        '</span><span class="announcement-time">' +
        list[n].time +
        "</span></div>";
    }
  }
}
tabNameDom.innerHTML = tabNameStr;
announcementDom.innerHTML = announcementStr;
newsDom.innerHTML = newsStr;
systemUpdateDom.innerHTML = systemUpdateStr;

// 设置tab-name对应的内容
var tabConList = [announcementDom, newsDom, systemUpdateDom];
var tabList = document.getElementsByClassName("tab-name");
for (var i = 0; i < tabList.length; i++) {
  tabList[i].index = i;
  tabList[i].onclick = function() {
    setInitTab(this.index);
  };
}

// 设置当前tab
function setInitTab(i) {
  for (var n = 0; n < tabList.length; n++) {
    tabList[n].classList.remove("tab-active");
  }
  tabList[i].classList.add("tab-active");
  for (var n = 0; n < tabConList.length; n++) {
    tabConList[n].style.display = "none";
  }
  tabConList[i].style.display = "block";
}

// 初始化tab
setInitTab(0);

// 业务报表，表格逻辑处理
var businessReport = [
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 45.5,
    thanLastmonth: -334.77,
    thanYear: 44355.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 435.5,
    thanLastmonth: -314.77,
    thanYear: 475.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 35.5,
    thanLastmonth: -3344.77,
    thanYear: 4568.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4345.5,
    thanLastmonth: -3354.77,
    thanYear: 47895.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -34364.77,
    thanYear: 443255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4365.5,
    thanLastmonth: -34534.77,
    thanYear: 4765.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4735.5,
    thanLastmonth: -3467.77,
    thanYear: 4678675.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4315.5,
    thanLastmonth: -34678.77,
    thanYear: 47805.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 435.5,
    thanLastmonth: -76934.77,
    thanYear: 43455.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4335.5,
    thanLastmonth: -34.77,
    thanYear: 43245.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4535.5,
    thanLastmonth: -434.77,
    thanYear: 4475.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4365.5,
    thanLastmonth: -5734.77,
    thanYear: 468695.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4835.5,
    thanLastmonth: -734.77,
    thanYear: 432465.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4035.5,
    thanLastmonth: -3004.77,
    thanYear: 43255.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4305.5,
    thanLastmonth: -364.77,
    thanYear: 45685.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4335.5,
    thanLastmonth: -3466.77,
    thanYear: 4655.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4335.5,
    thanLastmonth: -3794.77,
    thanYear: 43245.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4365.5,
    thanLastmonth: -37804.77,
    thanYear: 4475.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 4315.5,
    thanLastmonth: -3454.77,
    thanYear: 4455.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 435.5,
    thanLastmonth: -3544.77,
    thanYear: 45695.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 435.5,
    thanLastmonth: -32344.77,
    thanYear: 43425.5
  },
  {
    name: "各项存款（个人）",
    balance: "14.56",
    thanYesterday: 44635.5,
    thanLastmonth: -33454.77,
    thanYear: 34545.5
  }
];

// 表格分页
var pageSize = 10; // 每页展示条数
var currentPage = 1; // 当前页
var total = businessReport.length; // 总条数
var paginationCount = Math.ceil(total / pageSize); // 分页数量
var paginationDom = document.getElementsByClassName("pagination-count")[0];
var tableConDom = document.getElementsByClassName("table-con")[0];
var paginationStr = "";
var paginationData = {};
for (var i = 0; i < paginationCount; i++) {
  paginationData[i + 1] = businessReport.slice(
    i * pageSize,
    (i + 1) * pageSize
  );
  paginationStr += '<span class="pagination-item">' + (i + 1) + "</span>";
}
paginationDom.innerHTML = paginationStr;

// 分页点击事件
var paginationItems = document.getElementsByClassName("pagination-item");
for (var i = 0; i < paginationItems.length; i++) {
  paginationItems[i].index = i;
  paginationItems[i].onclick = function() {
    currentPage = this.index + 1;
    initTableData(currentPage);
  };
}

// 下一页点击事件
var paginationNext = document.getElementsByClassName("pagination-next")[0];
paginationNext.onclick = function() {
  if (currentPage >= paginationCount) {
    return;
  }
  currentPage = currentPage + 1;
  initTableData(currentPage);
};

// 上一页点击事件
var paginationPre = document.getElementsByClassName("pagination-pre")[0];
paginationPre.onclick = function() {
  if (currentPage <= 1) {
    return;
  }
  currentPage = currentPage - 1;
  initTableData(currentPage);
};

// 输入页数跳转事件
var paginationInput = document.getElementsByClassName("pagination-input")[0];
paginationInput.onblur = function() {
  if (paginationInput.value === "") {
    return;
  }
  var value = paginationInput.value - 0;
  if (value > paginationCount || value < 1) {
    paginationInput.value = "";
    alert("您输入的页码已超过范围，请重新输入");
    return;
  }
  initTableData(value);
  paginationInput.value = "";
};

// 设置点击分页高亮
function paginationActive(currentPage) {
  for (var i = 0; i < paginationItems.length; i++) {
    paginationItems[i].classList.remove("pagination-active");
  }
  paginationItems[currentPage - 1].classList.add("pagination-active");
}

// 表格数据渲染
/**
 * @param {*} className 判断点击的是哪个dom节点
 * @param {*} type 0：升序、1：降序
 */
function initTableData(currentPage, isSort, className, i) {
  var tableStr = "";
  var arr = paginationData[currentPage];
  if (isSort) {
    arr = tableSort(className, i, arr);
  } else {
    noSort();
    paginationActive(currentPage);
  }
  for (var i = 0; i < arr.length; i++) {
    tableStr +=
      '<div class="table-item"><span class="table-span">' +
      arr[i].name +
      '</span><span class="table-span">' +
      arr[i].balance +
      '</span><span class="table-span"><span>' +
      arr[i].thanYesterday +
      '</span><span class="updown-box"><i class="iconfont icon-' +
      (arr[i].thanYesterday > 0 ? "paixujiantoushang" : "paixujiantouxia") +
      '"></i></span></span><span class="table-span"><span>' +
      arr[i].thanLastmonth +
      '</span><span class="updown-box"><i class="iconfont icon-' +
      (arr[i].thanLastmonth > 0 ? "paixujiantoushang" : "paixujiantouxia") +
      '"></i></span></span><span class="table-span"><span>' +
      arr[i].thanYear +
      '</span><span class="updown-box"><i class="iconfont icon-' +
      (arr[i].thanYear > 0 ? "paixujiantoushang" : "paixujiantouxia") +
      '"></i></span></span></div>';
  }
  tableConDom.innerHTML = tableStr;
  // 判断表格是否有滚动条
  document.getElementsByClassName("table-head")[0].style[
    "padding-right"
  ] = hasScrolled(tableConDom, "vertical") ? "10px" : "0px";
}

// 初始化表格
initTableData(1);

// 头部排序点击事件
function sortClick(className) {
  var arr = document.getElementsByClassName(className);
  var all = document.getElementsByClassName("arrow-i");
  for (var i = 0; i < arr.length; i++) {
    arr[i].index = i;
    arr[i].onclick = function() {
      for (var n = 0; n < all.length; n++) {
        all[n].classList.remove("arrow-active");
      }
      arr[this.index].classList.add("arrow-active");
      initTableData(currentPage, true, className, this.index);
    };
  }
}
sortClick("than-yesterday-i");
sortClick("than-lastmonth-i");
sortClick("than-year-i");

// 清除排序标记
function noSort() {
  var all = document.getElementsByClassName("arrow-i");
  for (var i = 0; i < all.length; i++) {
    all[i].classList.remove("arrow-active");
  }
}

// 表格排序处理
function tableSort(className, type, arr) {
  var t = "";
  if (className === "than-yesterday-i") {
    t = "thanYesterday";
  } else if (className === "than-lastmonth-i") {
    t = "thanLastmonth";
  } else if (className === "than-year-i") {
    t = "thanYear";
  }
  arr.sort(function(a, b) {
    return (type ? 1 : -1) * (b[t] - a[t]);
  });
  return arr;
}
jeDate("#dateinfo", {
  isShow: false,
  theme: { bgcolor: "#409eff", color: "#ffffff", pnColor: "#00CCFF" },
  format: "YYYY-MM-DD hh:mm:ss",
  marks:['2020-02-05', '2020-02-08'],
});

// 工作督办
var workCheckList = [];
if (!workCheckList.length) {
  document.getElementsByClassName("no-work")[0].style.display = "block";
}
